package com.iss.demo.dao;

import com.iss.demo.entity.Shopcar;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ShopcarDao {

    @Select("select * from shopcar")
    List<Shopcar> selectAll();

    @Select("select * from shopcar where s_id=#{s_id}")
    public Shopcar selectByid(Integer id);

    @Insert("insert into shopcar(s_name,s_price,qf) VALUES (#{s_name},#{s_price},#{qf})")
    Integer insert(Shopcar shopcar);

    @Delete("delete from shopcar where s_id=#{s_id}")
    public Integer deleteOne(Integer s_id);

    @Delete("truncate table shopcar")
    Integer clear();
}
